package com.bawei.hgshop.service.impl;

import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import com.bawei.hgshop.entity.Spu;
import com.bawei.hgshop.entity.SpuVo;
import com.bawei.hgshop.mapper.SpuMapper;
import com.bawei.hgshop.service.SpuService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

/**
 * spu 的服务
 * @时间  2021-1-13  15:58:01
 *
 */
@Service(interfaceClass = SpuService.class)
public class SpuServiceImpl implements SpuService { 
	
	@Autowired
	SpuMapper spuMapper;	

	@Override
	public PageInfo<Spu> list(SpuVo spuVo) {
		// TODO Auto-generated method stub
		PageHelper.startPage(spuVo.getPage(), spuVo.getPageSize());
		return new PageInfo<Spu>(spuMapper.list(spuVo));
	}

	@Override
	public Spu getById(int id) {
		// TODO Auto-generated method stub
		return spuMapper.findById(id);
	}

	@Override
	public int add(Spu spu) {
		// TODO Auto-generated method stub
		return spuMapper.add(spu);
	}

	@Override
	public int update(Spu spu) {
		// TODO Auto-generated method stub
		return spuMapper.upddate(spu);
	}

	@Override
	public int delBatch(int[] ids) {
		// TODO Auto-generated method stub
		return spuMapper.delBatch(ids);
	}

}
